package com.smart.manager.system.entities.models;

import com.smart.common.entities.core.BaseLongModel;
import com.smart.manager.system.entities.views.ModuleView;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * 系统管理-接口功能
 * system_api
 * @author Administrator
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Accessors(chain = true)
public class SystemApi extends BaseLongModel {


    @ApiModelProperty("所属服务代码")
    @ManyToOne
    @JoinColumn(name = "module" ,referencedColumnName = "code")
    private ModuleView module;

    @ApiModelProperty("API标题")
    private String title;

    @ApiModelProperty("API地址")
    private String url;

    @ApiModelProperty("所在包名")
    private String pkgName;


    @ApiModelProperty("所在类名")
    private String clsName;

    @ApiModelProperty("执行函数")
    private String fun;

    @ApiModelProperty("请求方式")
    private String requestType ;

    @ApiModelProperty("MD5唯一值 16位")
    private String token;



    @ApiModelProperty("API权限表达式")
    @Length(max = 100, message = "编码长度不能超过100")
    private String expr;

    @ApiModelProperty("显示排序值")
    private Integer sort;

    @ApiModelProperty("是否是自定义接口")
    private Boolean custom;

}
